<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <th:block th:replace="~{/_include/header(css='none')}" />
    <title>[[${title ?:'REBUILD'}]]</title>
    <style>
      html,
      body {
        height: 100%;
        padding: 0;
        margin: 0;
        background-color: #fff;
      }
    </style>
  </head>
  <body>
    <div id="viewer" style="width: 100%; height: 100%"></div>
    <script th:src="${OnlyofficeServer + '/web-apps/apps/api/documents/api.js'}"></script>
    <script>
      if (window.DocsAPI) {
        // https://api.onlyoffice.com/docs/docs-api/usage-api/config/
        new DocsAPI.DocEditor('viewer', [(${_DocEditorConfig})])
      } else {
        alert('ONLYOFFICE API 加载失败')
      }
    </script>
  </body>
</html>
